/* 
 * File:   TrafficLight.cpp
 * Author: mikey
 * 
 * Created on August 25, 2010, 10:03 PM
 */

#include "TrafficLight.h"
#include <string>

using namespace std;

TrafficLight::TrafficLight() {
    lightState = 0;
}

void TrafficLight::goRed() {
    lightState = 0;
}

void TrafficLight::goAmber() {
    lightState = 5;
}

void TrafficLight::goGreen() {
    lightState = 1;
}

string TrafficLight::getState() {
    switch(lightState) {
            case 0:
                return "red";
                break;
            case 1:
                return "green";
                break;
            case 5:
                return "amber";
                break;
            default:
                return "err";
                break;
    }
}

int TrafficLight::getIntState() {
    return lightState;
}